/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "menuinventory")
@XmlRootElement(name = "menuinventory")
@NamedQueries({
    @NamedQuery(name = "Menuinventory.findAll", query = "SELECT m FROM Menuinventory m"),
    @NamedQuery(name = "Menuinventory.findByMenuinventoryID", query = "SELECT m FROM Menuinventory m WHERE m.menuinventoryID = :menuinventoryID"),
    @NamedQuery(name = "Menuinventory.findByDescription", query = "SELECT m FROM Menuinventory m WHERE m.description = :description"),
    @NamedQuery(name = "Menuinventory.findByIsdeleted", query = "SELECT m FROM Menuinventory m WHERE m.isdeleted = :isdeleted")})
public class Menuinventory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MenuinventoryID")
    private Long menuinventoryID;
    @Column(name = "description")
    private String description;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @JoinColumn(name = "menu_MenuID", referencedColumnName = "MenuID")
    @ManyToOne(optional = false)
    private Menu menu;
    @JoinColumn(name = "inventory_IdinventoryID", referencedColumnName = "IdinventoryID")
    @ManyToOne(optional = false)
    private Inventory inventory;

    public Menuinventory() {
    }

    public Menuinventory(Long menuinventoryID) {
        this.menuinventoryID = menuinventoryID;
    }

    public Long getMenuinventoryID() {
        return menuinventoryID;
    }

    public void setMenuinventoryID(Long menuinventoryID) {
        this.menuinventoryID = menuinventoryID;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Menu getMenu() {
        return menu;
    }

    public void setMenu(Menu menu) {
        this.menu = menu;
    }

    public Inventory getInventory() {
        return inventory;
    }

    public void setInventory(Inventory inventory) {
        this.inventory = inventory;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (menuinventoryID != null ? menuinventoryID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Menuinventory)) {
            return false;
        }
        Menuinventory other = (Menuinventory) object;
        if ((this.menuinventoryID == null && other.menuinventoryID != null) || (this.menuinventoryID != null && !this.menuinventoryID.equals(other.menuinventoryID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Menuinventory[menuinventoryID=" + menuinventoryID + "]";
    }

}
